package com.fary.consumer;

import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.core.annotation.AliasFor;

import static com.fary.constant.RabbitMQExchangeConstant.WECHAT_TEMPLATE_EXCHANGE;
import static com.fary.constant.RabbitMQQueueConstant.WECHAT_TEMPLATE_QUEUE;

@RabbitListener(bindings = @QueueBinding(
        value = @Queue(value = WECHAT_TEMPLATE_QUEUE, durable = "true", autoDelete = "true", arguments = @Argument(name = "x-queue-mode", value = "lazy")),
        exchange = @Exchange(value = WECHAT_TEMPLATE_EXCHANGE)
))
public @interface RabbitConsumer {

    @AliasFor(annotation = Queue.class)
    String value() default "";

    @AliasFor(annotation = Queue.class)
    String name() default "";
}
